package com.simblog.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONObject;
import com.simblog.common.constants.Constants;

@Controller
@RequestMapping("p/error")
public class ErrorController extends BaseController{
	
	@ResponseBody
	@RequestMapping("client_parameter_error")
	public JSONObject clientParameterError(){
		return assemblyJson(null, Constants.CLIENT_REQUIRED_PARAMETER_ERROR, "参数不完整");
	}
	
	@ResponseBody
	@RequestMapping("client_timestamp_error")
	public JSONObject clientTimestampError(){
		return assemblyJson(null, Constants.CLIENT_TIMESTAMP_ERROR, "客户端时间异常");
	}
	
	@ResponseBody
	@RequestMapping("token_null_error")
	public JSONObject tokenNullError(){
		return assemblyJson(null, Constants.TOKEN_NULL_ERROR, "token异常");
	}
	
	@ResponseBody
	@RequestMapping("token_expired_error")
	public JSONObject tokenExpiredError(){
		return assemblyJson(null, Constants.TOKEN_EXPIRED_ERROR, "token已经过期，请重新登录");
	}
	@ResponseBody
	@RequestMapping("sign_validate_error")
	public JSONObject signValidateError(){
		return assemblyJson(null, Constants.SIGN_VALIDATE_ERROR, "签名验证失败");
	}
}
